<template>
  <van-swipe :autoplay="3000" class="swiper">
    <van-swipe-item v-for="(image, index) in images" :key="index">
      <van-image
        class="image" 
        fit:fill
        lazy-load
        :src="image"
      />
    </van-swipe-item>
  </van-swipe>
</template>

<script>
import Vue from "vue";
import { Lazyload, Swipe, SwipeItem,Image } from "vant";
Vue.use(Lazyload).use(Swipe).use(SwipeItem).use(Image);
export default {
  data() {
    return {
      images: [],
    };
  },
  async mounted() {
    let result=await this.$http.get({
      url:'/api/swiper'
    }
    )
    console.log(result);
    this.images=result.data.data
  },
};
</script>

<style lang="stylus" scoped>
.swiper {
  height: 173px;

  .image{
    width: 100%;
    height: 100%;
  }
}
</style>